<template>
    <div class="box">
        <div class="top">
            <div class="conter">

                <div class="left">
                    <img src="../assets/b2.jpg" alt="">
                    <div @click="isLogin">立即登录</div>
                </div>

                <div class="right">


                    <div class="info">
                        <div class="title">开通会员，立享特权</div>
                        <button @click="isLogin" type="button" class="">
                            <span>立即开通</span>
                        </button>
                    </div>


                </div>

            </div>
        </div>

        <div class="bot">
            <div class="member">
                <div class="group-title">
                    -会员特权-
                </div>
                <div class="vip-privilege-box">
                    <div class="li">
                        <img src="../assets/1.png" alt="">

                        <div class="name">VIP曲库</div>
                        <div class="intro">独享更多VIP专属曲库内容（不含数字专辑）</div>
                    </div>

                    <div class="li">
                        <img src="../assets/11.png" alt="">
                        <div class="name">无损音质</div>
                        <div class="intro">为VIP会员提供SQ无损音质服务，听到细节</div>
                    </div>

                    <div class="li">
                        <img src="../assets/3.png" alt="">
                        <div class="name">身份特权</div>
                        <div class="intro">VIP尊贵标识，优先享有新功能特权</div>
                    </div>
                </div>
            </div>


            <div class="vipplaylist">
                <div class="group-title">-会员歌单-</div>

                    <div class="box-info">
                <div class="infos" v-for="(info, k) in info" :key="k" >
                    <router-link :to="'/song/' + info.id">
                        <div class="pic">
                            <img v-lazy="info.coverImgUrl" alt="" />
                        </div>

                        <p>{{info.name}}</p>

                        <div class="play"><span></span></div>

                    </router-link>
                </div>
            </div>
            </div>
        </div>
        <login :isshow="show" />
     
    </div>
        
</template>

<script>
    import login from '../components/login'

    export default {
        components: { login },
        data() {
            return {
                show: { isshow: false },
                isUser: false,
                info: "",
                      
            }
        },
        beforeRouteEnter(to, from, next) {
            next((vm) => {
                vm.getInfo();
            });
        },
        methods: {
            isLogin() {
                this.show.isshow = !this.show.isshow
            },

            getInfo() {
                var url = `https://autumnfish.cn/top/playlist/highquality?limit=10`;
                this.axios.get(url).then((res) => {
                    this.info = res.data.playlists
                });
            },
        },
    }
</script>

<style scoped>
    a{
        text-decoration: none;
    }
    .conter {
        width: 80vw;
        margin: 0 auto;
        display: flex;
        padding: 50px 100px 0 100px;
        justify-content: space-between;
    }

    .top {
        width: 100vw;
        background-color: #333333;
    }

    .left {
        display: flex;
        align-items: center;
    }

    .left img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
    }

    .left div {
        color: #fff;
        margin-left: 30px;
        font-size: 14px;
        cursor: pointer;
    }

    .right {
        width: 680px;
        height: 250px;
        background: url(https://static1-music.taihe.com/client/img/f09046e.png) 50% no-repeat;
    }

    .info {
        padding: 0 60px;
        margin-top: 65px;
    }

    .title {
        font-size: 36px;
    }

    .info button {
        padding: 17px 40px;
        border-radius: 25px;
        background: #333;
        margin-top: 25px;
        color: #fff;

    }

    .bot {
        width: 80vw;
        margin: 0 auto;
    }


    .group-title {
        margin: 100px 0 40px;
        text-align: center;
        font-size: 28px;
    }

    .vip-privilege-box {
        display: flex;
        justify-content: space-between;
    }

    .vip-privilege-box .li {
        background: #f8f8f8;
        text-align: center;
        padding: 60px 30px;
    }

    .vip-privilege-box .li .name {
        margin: 20px 0 8px;
        font-size: 20px;
    }

    .vip-privilege-box .li .intro {
        color: #909399;
        font-size: 14px;
    }

    .box-info{
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

 .infos {
    position: relative;
    width: 18%;
    margin: 20px 0;
    }
 .infos a {
    display: flex;
    flex-direction: column;
    }
    .infos a .pic {
    width: 100%;
    height: 224px;
    overflow: hidden;
    }
    .pic img {
    width: 100%;
    height: 100%;
    }
 .infos a p {
    width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 10px 0;
    color: #333;
    
    }
  .infos:hover .play {
    display: block;
    }
 .infos .play {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #fff;
    position: absolute;
    left: 0;
    top: -80px;
    right: 0;
    bottom: 0;
    margin: auto;
    display: none;
    }
 .infos .play span {
    border: 15px solid transparent;
    border-left: 20px solid #c89977;
    display: inline-block;
    margin-left: 18px;
    position: absolute;
    top: 25%;
    left: 6%;
    }
 .infos:hover img {
    transform: scale(1.05);
    }
   .infos img {
    width: 100%;
    height: 224px;
    transition: all 0.6s;
    }

</style>